#ifndef  __COMBAT_DATA_DUMMY__IMP__
#define  __COMBAT_DATA_DUMMY__IMP__


#include "CombatSysIf.h"
#include "CombatDefinition.h"
#include "CombatSkill.h"

class IEntity;
class CombatSkill;

/*
*
*	Combat System Dummy Implementation
*	For those who love peace.
*
*/
class TCOM_API  CombatSysDummy : public ICombatSys
{
public:
	CombatSysDummy();
	virtual ~CombatSysDummy();

	//
	//	Entity Extension Data for combat
	//	For setExtData nValue is the value to set
	//	For getExtData nValue is the default value , when failed to get specific data
	//
	virtual void	setExtData(short nIdx, const int& nValue = 0);
	virtual int		getExtData(short nIdx, const int& nValue = 0);

	//
	//	
	//
	int			getHP()const;
	int			getMaxHP()const;
	int			getMP()const;
	int			getHPPercentage()const;
	int			getMPPercentage()const;

	int			getBottleHP()const;
	int			getBottleMP()const;
	int			getHpBottleNum() const;
	int			getMpBottleNum() const;

	//
	//	Entity Combat Levels. Stat.
	//
	virtual int	getLevel(short nIdx) = 0;
	//
	//
	//
	int		getLevelModifier(short nIdx);
	bool	updateLevelModifier(short nIdx, short nAffectValue);

	//
	//	Entity Combat add Experience
	//	return true if level up
	//
	virtual	bool addExp(short nIdx,int nValue = 1) = 0;

	//
	//	Entity Combat Data update
	//
	virtual	void	updateHPByPercentage(int nPercent);
	virtual	void	updateHP(int nAffectValue);
	virtual	void	updateMP(int nAffectValue);
	virtual	void	updateMaxHP(int nAffectValue);
	virtual	void	updateHPBottleValue(int nAffectValue);
	virtual	void    updateMPBottleValue(int nAffectValue); 

	//
	//	Entity Immunity
	bool	addImmunity(int nKey);
	bool	rmvImmunity(int nKey);
	bool	hasImmunity(int nKey)const;

	// 
	//	Fire when the gene is attached on a unit. just like unit enter the state.
	//
	virtual bool onAttach();

	// 
	//	Fire when the gene is attached on a unit. just like unit enter the state.
	//
	virtual bool onDetach();

	// 
	//	Periodically update gene logic, normally a gene will be detach when run out of its time to live.
	//
	virtual bool onUpdate(const int& nElapse);

	// 
	//	onEvent callback from hook manager
	//
	virtual void onEvent(IEvt& evt);

	//
	//	onEvent event handlers
	//
	virtual void onEvent_CastPrep(IEvt& evt);
	virtual void onEvent_Cast(IEvt& evt);
	virtual void onEvent_Target(IEvt& evt);
	virtual void onEvent_CastResult(IEvt& evt);

	//
	//	Calculator or Demonstrator
	virtual	bool isCalculator()const = 0;

	bool	hasSkill(short& nStyle)const;
	bool	hasSequence(const short& nSeq)const;

	//
	//	UI Effects
	//
	bool	EffectUpdate_CastStart(int& nTTL);		//	response on server's cast start notification
	bool	EffectUpdate_CastCancel();				//	cast is cancelled, maybe send a cancel message to server
	bool	EffectUpdate_CastEnding();				//	An logic step, calculator will send cast end request to server
	bool	EffectUpdate_CastEnded();				//	response on server's cast end notification
	//
	//	Target of current casting
	IEntity*	getTarget(const int& nTargetID ); 
	IEntity*	getTargetCC();
	//
	//	Target of current enemy
	void				setTargetCE(int nUIID){		}
	IEntity*			getTargetCE();
	int		getTargetCE_ID()const			{	return 0;	}
	bool				hasTargetCE()const				{	return false;	}

	//
	//	Spell to cast
	virtual bool TryCastNewSpell() = 0;

	//
	//	Send Combat Messages
	bool sendMsg_CbtTargt(IEntity& t);
	bool sendMsg_CbtStart(IEntity& t, CombatSkill& ab);
	bool sendMsg_CbtEnd();
	bool sendMsg_CbtCancel();
};

#endif
